<!DOCTYPE html>  
<html lang="en">  
<head>  
    <meta charset="UTF-8">  
    <meta name="viewport" content="width=device-width, initial-scale=1.0">  
    <title>Calculator</title>  
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>  
    <style>  
        #app{
            padding-right: 10px;
            width: 300px;
            height: 250px;
            background-color:#f0eeee;
        }
        .cin_item{
            margin: 10px;
            width: 280px;
            height: 80px;
            font-size: 48px;
        }
        .item{
            margin-top: 10px;
            margin-left: 10px;
            width: 50px;
            height: 30px;
            float: left;
            background-color: #c0bebe;
            line-height: 30px;
            font-size: 20px;
            text-align: center;
        }  
    </style>  
</head>  
<body>  
    <div id="app">  
        <div>  
            <input type="text" v-model="display" class="cin_item" readonly>  
        </div>  
        <div class="content">  
            <div class="item" @click="append('0')">0</div>  
            <div class="item" @click="append('1')">1</div>  
            <div class="item" @click="append('2')">2</div>  
            <div class="item" @click="append('3')">3</div>
            <div class="item" @click="append('4')">4</div>  
            <div class="item" @click="append('5')">5</div>
            <div class="item" @click="append('6')">6</div>  
            <div class="item" @click="append('7')">7</div>
            <div class="item" @click="append('8')">8</div>  
            <div class="item" @click="append('9')">9</div>
            <div class="item" @click="append('+')">+</div>  
            <div class="item" @click="append('-')">-</div>  
            <div class="item" @click="append('*')">*</div>  
            <div class="item" @click="append('/')">/</div>  
            <div class="item" @click="calculateResult">=</div>  
        </div>  
    </div>  
    <script>  
        const app = Vue.createApp({  
            data() {  
                return {  
                    display: '', 
                    expression: '', 
                };  
            },  
            methods: {  
                append(char) {  
                    if (char === '=') {  
                        try {  
                            this.display = eval(this.expression);   
                            this.expression = ''; 
                        } catch (error) {  
                            this.display = 'Error';   
                        }  
                    } else {  
                        this.expression += char; 
                        this.display = this.expression; 
                    }  
                },  
                calculateResult() {  
                    this.append('='); 
                },  
            },  
        });  
        app.mount('#app');  
    </script>  
</body>  
</html>